<?php

/**
 * Idioma form.
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class IdiomaForm extends BaseIdiomaForm
{
  public function configure()
  {
      //Eliminar los campos del formularios  created_at y updated_at
      unset (
        $this['created_at'],
        $this['updated_at'],
        $this['orden']

      );
      
      $this->widgetSchema['empresa_id'] = new sfWidgetFormInputHidden(array(),array('value'=> sfContext::getInstance()->getUser()->getAttribute('agente_user_empresa_id')));
      
      //Cambiar a lista y su validador de los status Activo e Inativo 0/1
      $this->widgetSchema['status'] = new sfWidgetFormChoice(array(
         'choices' => Idioma::$status,
         'expanded' => false,
         'multiple' => false,

      ));

      $this->validatorSchema['status'] = new sfValidatorChoice(array(
          'choices' => array_keys(Idioma::$status),

      ));
      
      //Cambiar a lista y su validador de los status Activo e Inativo 0/1
      $this->widgetSchema['is_default'] = new sfWidgetFormChoice(array(
         'choices' => Idioma::$default,
         'expanded' => false,
         'multiple' => false,

      ));

      $this->validatorSchema['is_default'] = new sfValidatorChoice(array(
          'choices' => array_keys(Idioma::$default),

      ));


      $this->widgetSchema['empresa_list']->setOption('renderer_class', 'sfWidgetFormSelectDoubleList');
      $this->widgetSchema['empresa_list']->setLabel('Listar Empresa');

  }
}
